home *** CD-ROM | disk | FTP | other *** search
- class classes.bro.IntroBro1
- {
- var x;
- var y;
- var clip;
- var dir;
- var oldDir;
- var c = 0;
- var xMov = 0;
- var yMov = 0;
- var xA = 0;
- var yA = 0;
- var state = "walk";
- var f2 = "working";
- function IntroBro1(px, py)
- {
- this.x = px;
- this.y = py;
- this.clip = _root.attachMovie("introBro1","introBro1Clip",90500);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.clip.gotoAndStop("work");
- this.dir = "work";
- }
- function working()
- {
- if(random(1000) > 998)
- {
- if(!_root.bro2Cooler)
- {
- _root.bro1Cooler = true;
- this.x = 762 + this.clip.work.xTracker._x;
- _root.introScreen.bro1._visible = true;
- _root.introScreen.bro1.gotoAndStop("noBro");
- this.dir = "L";
- this.xMov = -3;
- this.f2 = "goingToCooler";
- }
- }
- }
- function startGame()
- {
- if(this.dir == "work")
- {
- this.x = 762 + this.clip.work.xTracker._x;
- }
- else if(this.dir == "cooler")
- {
- this.x = 690 + this.clip.cooler.xTracker._x;
- }
- this.f2 = "";
- _root.introScreen.bro1._visible = true;
- _root.introScreen.bro1.gotoAndPlay("noBro");
- this.dir = "L";
- this.xMov = -5;
- }
- function goingToCooler()
- {
- if(this.x <= 690)
- {
- this.x = 690;
- this.xMov = 0;
- this.dir = "cooler";
- this.f2 = "cooler";
- }
- }
- function cooler()
- {
- if(this.clip.cooler.end)
- {
- this.x = 639;
- this.dir = "R";
- this.xMov = 3;
- this.f2 = "gotoWork";
- }
- }
- function gotoWork()
- {
- if(this.x >= 759)
- {
- _root.bro1Cooler = false;
- this.x = 735;
- this.dir = "work";
- this.xMov = 0;
- this.f2 = "working";
- _root.introScreen.bro1._visible = false;
- }
- }
- function wait()
- {
- this.state = "wait";
- this.dir = "";
- this.xMov = 0;
- }
- function gotoPunchOut()
- {
- this.clip.body.gotoAndPlay("walk");
- this.xMov = -4;
- }
- function punchOut()
- {
- this.xMov = 0;
- this.clip._x = 264;
- this.clip.body.gotoAndPlay("punchOut");
- _root.coins.addTo(7);
- _root.audio.playLevel3("coin5",_root.randRange(21,24));
- }
- function exit()
- {
- this.clip.body.gotoAndPlay("walk");
- this.x = 261;
- this.xMov = -5;
- this.f2 = "exiting";
- _root.introBro2Clip._alpha = 0;
- this.clip.setMask(_root.introBroMaskClip);
- this.clip._alpha = 150;
- }
- function exiting()
- {
- this.clip._alpha -= 3;
- }
- function main()
- {
- this[this.f2]();
- if(this.oldDir != this.dir)
- {
- this.clip.gotoAndStop(this.dir);
- this.clip.body.gotoAndPlay(this.state);
- }
- this.oldDir = this.dir;
- this.x += this.xMov + this.xA;
- this.y += this.yMov + this.yA;
- this.clip._x = this.x;
- this.clip._y = this.y;
- }
- }
-